package com.no1.zy.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/web")
@Slf4j
public class WebController {

    @RequestMapping("demo1")
    @ResponseBody
    public String demo1(@RequestParam Integer id,@RequestParam String name){
        log.info("从前台获取参数: id->"+id+";name->"+name);
        return "测试一";
    }
    @RequestMapping("demo2/{id}")
    @ResponseBody
    public String demo2(@PathVariable Integer id){
        log.info("接到前台请求参数: id->"+id);
        return "测试二";
}}
